import Vue from 'vue'

import {
  ACCESS_TOKEN
} from '@/store/mutation-types';

const user = {
  state: {
    token: null,
  },
  mutations: {
    [ACCESS_TOKEN]: (state, token) => {
      state.token = token
    }
  },
  actions: {
    setToken({ commit }, token) {
      commit(ACCESS_TOKEN, token)
    }
  }
}

export default user;